package sprint.view;
/*
Project name     : Sprint
Project Descript : �α��� ��
Project Manager  : Jimmy Kim
Company          : Blue
Class Create Day : 2014/02/10
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.util.ArrayList;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import sprint.model.LoginModel;

@SuppressWarnings("serial")
public class LoginView extends JPanel{

	public JPanel oneSmole = new JPanel(new BorderLayout(20,20));
	public JPanel twoSmole = new JPanel(new BorderLayout(20,20));
	public JPanel threeSmole = new JPanel(new BorderLayout(20,20));	
	public JPanel southP = new JPanel(new GridLayout(2,1));
	public JButton login = new JButton("로그인");
	public JButton join = new JButton("가입");
	public JButton joinbt = new JButton("Join");
	public Icon icon = new ImageIcon("image/logo.jpg");
	public JLabel logo = new JLabel(icon);
	public JLabel id = new JLabel("ID      : ",JLabel.CENTER);
	public JLabel pw = new JLabel("PassWord: ",JLabel.CENTER);
	public JLabel joinId = new JLabel("ID      : ",JLabel.CENTER);
	public JLabel joinPw = new JLabel("PassWord: ",JLabel.CENTER);	
	public JLabel message =new JLabel("Login 중 입니다",JLabel.CENTER);
	public Font f1 = new Font("Bold",Font.BOLD,30);
	public JTextField iputId = new JTextField();	
	public JTextField ipuPw = new JTextField();
	public JTextField joinInId = new JTextField();
	public JTextField joinInPw = new JTextField();
//	public JDialog loginDialog = new JDialog();
	public JDialog joinDialog = new JDialog();	

	ArrayList<LoginModel> transLogin ;
	
	public LoginView(){
		message.setFont(f1);
		loginGrideView();
//		loginDialogGui();
		JoinDialogGui();
		
	}

	private void loginGrideView() {
		// TODO Auto-generated method stub
		setLayout(new BorderLayout(20,20));
		
		oneSmole.setBackground(Color.white);
		twoSmole.setBackground(Color.white);
		threeSmole.setBackground(Color.white);
		southP.setBackground(Color.white);
		
		this.add("North",new JLabel("   "));
		this.add("South",new JLabel("    "));
		this.add("West",new JLabel("   "));
		this.add("East",new JLabel("   "));
		this.add("Center", oneSmole);

		oneSmole.add("North",new JLabel("   "));
		oneSmole.add("South",new JLabel("   "));
		oneSmole.add("West",new JLabel("   "));
		oneSmole.add("East",new JLabel("   "));
		oneSmole.add("Center",twoSmole);
			
		twoSmole.add("North",logo);	
		twoSmole.add("South",southP);
		twoSmole.add("West",new JLabel("   "));
		twoSmole.add("East",new JLabel("   "));								
		twoSmole.add("Center",new JLabel("   "));
									
			JPanel cp = new JPanel(new GridLayout(3,2));
			cp.setBackground(Color.white);
			southP.add(cp);
				cp.add(id);			
				cp.add(iputId);
				cp.add(pw);
				cp.add(ipuPw);
				cp.add(new JLabel(" "));
				
			JPanel np = new JPanel(new GridLayout(3,1)); 
			np.setBackground(Color.white);
			southP.add(np);
				np.add(login);
				np.add(new JLabel("   "));
				np.add(join);
		
	}


/*	public void loginDialogGui() {
		// TODO Auto-generated method stub
		loginDialog.setLayout(new BorderLayout());
		loginDialog.setBackground(Color.white);
		loginDialog.add("North", new JLabel("       "));
		loginDialog.add("South", new JLabel("       "));
		loginDialog.add("East", new JLabel("       "));
		loginDialog.add("West", new JLabel("       "));
		JPanel jsep = new JPanel(new GridLayout(1,1,10,10));
		jsep.setBackground(Color.white);
		message.setFont(f1);
		jsep.add(message);
		loginDialog.add("Center", jsep);
		loginDialog.setSize(300,150);
		Dimension mys = loginDialog.getSize();
		Dimension src = Toolkit.getDefaultToolkit().getScreenSize();
		loginDialog.setLocation(src.width/2-mys.width/2,src.height/2-mys.height/2);
	}
	*/
	public void JoinDialogGui() {
		// TODO Auto-generated method stub
		joinDialog.setLayout(new BorderLayout());
		joinDialog.setBackground(Color.white);
		joinDialog.add("North", new JLabel("       "));
		joinDialog.add("West", new JLabel("       "));
		joinDialog.add("East", new JLabel("       "));
		JPanel wp = new JPanel(new GridLayout(1,1));
		wp.setBackground(Color.white);
		wp.add(joinbt);
		joinDialog.add("South", wp);
		JPanel jsep = new JPanel(new GridLayout(2,2));
		jsep.setBackground(Color.white);
		jsep.add(joinId);
		jsep.add(joinInId);
		jsep.add(joinPw);
		jsep.add(joinInPw);
		joinDialog.add("Center",jsep);
		joinDialog.setSize(300,150);
		Dimension mys = joinDialog.getSize();
		Dimension src = Toolkit.getDefaultToolkit().getScreenSize();
		joinDialog.setLocation(src.width/2-mys.width/2,src.height/2-mys.height/2);
	}
	
	

}
